package com.haowan123.qinmeiren.appota2.imgtool;

import java.io.File;

import com.haowan123.qinmeiren.appota2.CommonUtils;
import com.haowan123.qinmeiren.appota2.R;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;

public class ImageBlurUtil {

	public static final int radisBlur = 23;

	public static Bitmap getBlurBitmap(Activity context) {
		Bitmap newImg = null;
		if (!checkFileExist()) {
			newImg = BitmapFactory.decodeResource(context.getResources(), R.drawable.blur_bg);
//			newImg = Blur.fastblur(context, newImg, radisBlur);
//			ImageUtils.storeImage(newImg, CommonUtils.blurImgPath);
			Log.e("","Load from resource");
		}else{
			newImg = ImageUtils.getBitMap(CommonUtils.blurImgPath,context);
			Log.e("","Load from cache");
		}
		return newImg;
	}

	public static boolean checkFileExist() {
//		File file = new File(CommonUtils.blurImgPath);
//		if (file.exists()) {
//			return true;
//		}
		return false;
	}
}
